/**
 * utils.h
 */

#ifndef _UTILS_H
#define _UTILS_H	1

#include <string.h>

/* utility functions for the sources */
int cfgstr2bool(const char *s, int *bo);
int cfgstr2int(const char *s, int *i);
int cfgstr2double(const char *s, double *d);
int collect_data_from_file(const char *fname, const char *sep, int num,
	const char *idlist[], char *valuelist[]);
ssize_t sendall(int s, const void *buf, size_t len, int flags);
char *base64_encode(const char *s, size_t len);

#define strstartswith(x, y) (!strncmp(x, y, strlen(y)))
#define NEW(c) ((c *)malloc(sizeof(c)))

#endif /* _UTILS_H */
